To access the data contained in databases, such as an SQL (structured query language) database, queries or statements are used by a database management system (DBMS). A collection of these queries, which are to be executed by the DBMS is defined as a workload. The computational complexity or cost of execution of a workload in terms of metrics such as time required for execution or resources required for execution, such as memory, grows geometrically or even exponentially with the complexity or size (e.g. number of queries) of the workload. For example, the execution of a hundred queries can be four orders of magnitude more expensive in terms of required execution time than a single query. Therefore, it is relatively more costly to execute a complex workload with multiple queries rather than executing multiple simple workloads with fewer queries. In order to reduce the cost of executing a workload based upon metrics such as, for example, execution time, compression techniques have been developed for compressing workloads by reducing a large set of queries to a smaller set of queries which adequately represent the overall workload. Typically, the more complex a query in a workload is, (i.e. the higher execution cost) the more benefit will be obtained by compression of the query. However, the benefit gained by compressing a workload can be negated by the overall cost and resources required to compress the workload itself.
Therefore, there is a need for a method, system and computer program product that balances the cost of workload compression versus the cost of workload execution.